Instructions for replicating the analysis presented in "A Populist Axis? Analyzing Connections between Populist, Economic, and Cultural Dimensions of Political Space"

** Software: **

The analysis was conducted using R 4.4.0 and RTools 4.4, and the following R packages:

Data wrangling: dplyr (1.1.4), tidyr (1.3.1), tibble (3.2.1), openxlsx (4.2.5.2), haven (2.5.4), countrycode (1.6.0)
Survey data analysis: survey (4.4-2)
Multiple imputations: mice (3.16.0)
Data visualization: ggplot2 (3.5.1), ggrepel (0.9.5), patchwork (1.2.0), ggplotify (0.1.2), lattice(0.22.6), latticeExtra(0.6.31)
Modelling: lavaan (0.6-19), Rcpp (1.0.12), RcppArmadillo (0.12.8.4.0), abind (1.4-8)

** Input data: **

"data/PRECEDE3_survey.sav": An excerpt from the "PRECEDE3" survey data. The data were collected in 2023 by Kieskompas on behalf of the Consortium "Populism's Roots: Economic and Cultural Explanations in Democracies of Europe (PRECEDE)" (www.precede.eu).

"data/PEPS_plus.sav": The party-level dataset derived from the expert survey on party positions (PEPS) with a few additional party-level variables. PEPS data were collected by the Consortium "Populism's Roots: Economic and Cultural Explanations in Democracies of Europe (PRECEDE)" (www.precede.eu) in 2020-2023.

"misc_inputs/manifest_variables.xlsx": The list of manifest variables used in the measurement model with essential information.

"misc_inputs/Census benchmarks.rds": The population benchmarks for raking, based on the 2021 EU Census Data.

"misc_inputs/vote_distribution.xlsx": The distribution of votes in the preceding elections, used as the population benchmarks for raking on the recalled vote choice.

** Scripts for replicating the findings: **
"src/misc.cpp": Miscellaneous C++ functions used in estimation and post-estimation

"1 - prepare data.R": combines data from multiple sources, calculates sampling weights, and runs multiple imputations.
Relies on: "data/PRECEDE3_survey_abbr.sav", "data/PEPS_plus.sav", "misc_inputs/manifest_variables.xlsx"
Outputs: "data/ready_for_CFA.RData" (imputed datasets with manifest variables), "data/additional_data.RData" (additional information about respondents and parties)

"2 - measurement model estimation.R": estimates CFA models and outputs model statistics and scores for voters and parties
Relies on: "data/ready_for_CFA.RData", "data/additional_data.RData", and "misc_inputs/manifest_variables.xlsx"
Outputs: "data/analysis_data.RData", "output/mfit_bycountry.tex" (measurement model fit statistics), "output/mestimates_bycountry.tex" (measurement model estimates)

"3 - landscapes.R": describes and visualizes the political landscapes
Relies on: "data/analysis_data.RData", "data/additional_data.RData"
Outputs: "output/figure2.pdf", "output/figure3.pdf", "output/figure4.pdf", "output/figure5.pdf", as well as country-specific landscapes

"4 - regression models.R": estimates the parameters of vote choice models
Relies on: "data/analysis_data.RData" and "src/misc.cpp"
Outputs: "output/rum_estimates.rds" (list of model estimates)

"5 - export estimates.R": exports model summaries
Relies on: "data/analysis_data.RData" and "rum_estimates.rds"
Outputs: "output/est_rums.txt" (tables with model estimates)

"6 - crossvalidation.R": produces model fit statistics
Relies on: "data/analysis_data.RData", "src/misc.cpp", and "output/rum_estimates.rds"
Outputs: "output/table2.tex"

"7 - vote model interpretation.R": interprets the estimates of the vote choice models
Relies on: "data/analysis_data.RData", "src/misc.cpp", and "output/rum_estimates.rds"
Outputs: "output/figure6.pdf", "output/figure7.pdf", "output/figure8A.pdf", "output/figure8B.pdf", "output/figure8C.pdf", "output/figure8D.pdf",
"complementarities.pdf" (estimates of the complementarity measures)


